<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>运营平台</title>
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/datetimepicker.css" />
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/fontawesome.css" />
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/fonts.css" />
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/bootgrid.css" />
	<link rel="stylesheet" type="text/css" href="/App/Admin/Public/css/style.css" />
	
</head>

<body>
<div class="topNav">
    <span class="text"><i class="iconfont">&#xe607;</i><a href="<?php echo U('Index/index');?>" target="_top">首页</a>><span>商家管理</span></span>
</div>

<div class="contain">
    <div class="pageTitle">
        <h2 class="title">商家管理</h2>
    </div>
    <div class="searchBox">
        <form action="<?php echo U('shopMange/index');?>" method="post">
         <!--{{csrf_field()}}-->
            <!-- formOne formTwo formThree formFour(备用) -->
            <div class="formOne formDivide formBusiness"> 
                <div class="line">
                    <span class="name">商家类别</span>
					
					
					
                     <div class="col-md-3 col-sm-10 col-xs-3">
                        <select id="select_id1" class="inpTextOne form-control" name="select_name1">
                            <option selected="selected" value="">请选择</option>
							
							  <?php if(is_array($list1) && !empty($list1) ): foreach($list1 as $key=>$item): ?><option  value="<?php echo ($item['id']); ?>"><?php echo ($item['class_name']); ?></option><?php endforeach; else: endif; ?>
					     </select>
                    </div>
					
					
                    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select class="inpTextOne form-control" id="select_id2" name="select_name2">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
					
					
                    <div class="col-md-3 col-sm-10 col-xs-3">
                    <select class="inpTextOne form-control"  id="select_id3" name="select_name3" >
                           <option selected="selected" value="">请选择</option>
                    </select>
                </div>
				
				
				
                    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select class="inpTextOne form-control"  id="select_id4" name="select_name4">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
					
					
					
					
					
					
                </div>
                               <div class="line">
                    <span class="name">所在地</span>
                 
				 
				    <div class="col-md-3 col-sm-10 col-xs-3">   
                        <select  id="select_id5" class="inpTextOne form-control" name="select_name5">
                            <option selected="selected" value=''>请选择</option>
                            <?php if(is_array($listAddress) && !empty($listAddress) ): foreach($listAddress as $key=>$item): ?><option value="<?php echo ($item['id']); ?>" ><?php echo ($item['name']); ?></option><?php endforeach; else: endif; ?>
                        </select>
                    </div>
                   
				   
				   
				    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select id="select_id6"  class="inpTextOne form-control" name="select_name6">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
                  
				  
				    <div class="col-md-3 col-sm-10 col-xs-3">
                        <select  id="select_id7" class="inpTextOne form-control" name="select_name7">
                           <option selected="selected" value="">请选择</option>
                        </select>
                    </div>
					
					
					
                </div>
            <div class="formTwo formDivide formBusiness">
               
			
				 <div class="line">
                    <span class="name">开店时间</span>
                    <div class="col-md-3 col-sm-5 col-xs-4">
                        <input type="text" name="from_time"  value="<?php echo ($shArray['from_time']?$shArray['from_time']:''); ?>" class="inpTextOne form-control datetimepicker">
                    </div>
                    <div class="col-md-3 col-sm-5 col-xs-4">
                        <input type="text" name="to_time"  value="<?php echo ($shArray['to_time']?$shArray['to_time']:''); ?>" class="inpTextOne form-control datetimepicker">
                    </div>
                </div>
				
                <div class="line">
                    <span class="name">关键字</span>
                    <div class="col-md-6 col-sm-10 col-xs-8">
                      
						<input type="text" name="sh_q"  value="<?php echo ($shArray["sh_q"]); ?>"  class="inpTextOne form-control" placeholder="ID、商铺名">
                    </div>
                </div>
            </div>
            <div class="formThree formDivide formBusiness">
                <div class="line">
                    <div class="marl85 col-md-9 addPdding">
                        <input  type="submit" class="btn btn-success btn-lg" value="查询">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="tableBoxOne">
        <div class="pageTitle">
            <h2 class="title">检索结果</h2>
        </div>
        <div class="scroll">
            <table id="grid" class="table table-bordered" data-selection="false" data-multi-select="false" data-row-select="false" data-keep-selection="false">
            <thead>
                    <tr>
                        <th data-column-id="01" data-width="150">商铺号（ID）</th>
                        <th data-column-id="02" data-width="120" >店铺名</th>
                        <th data-column-id="03" data-width="100">商家类别</th>
                        <th data-column-id="04" data-width="130">店主姓名</th>
                        <th data-column-id="05" data-width="120">手机号</th>
                        <th data-column-id="06" data-width="180">开店时间</th>
                        <th data-column-id="07" data-width="250">身份证号</th>
                        <th data-column-id="08" data-width="250">银行卡</th>
                        <th data-column-id="09" data-width="150">所在省</th>
                        <th data-column-id="10" data-width="150">所在市</th>
                        <th data-column-id="10" data-width="150">大学</th>
                        <th data-column-id="11" data-width="120">扣点</th>
                        <th data-column-id="12" data-width="120">状态</th>
                        <th data-column-id="13" data-width="120"  data-formatter="businessMangedDetailA" data-sortable="true">商品管理</th>
                        <th data-column-id="13" data-width="120"  data-formatter="businessMangedDetailA" data-sortable="true">国际品牌</th>
                        <th data-column-id="14" data-width="180"  data-formatter="businessMangedDetailB" data-sortable="true">操作</th>
                    </tr>
            </thead>
                <tbody>
				
				
                <?php if(is_array($list) && !empty($list) ): foreach($list as $key=>$item): ?><tr>
                        <td><?php echo ($item["id"]); ?></td>
                        <td><?php echo ($item["shop_name"]); ?></td>
                        <td><?php echo ($item["class_name"]); ?></td>
                        <td><?php echo ($item["keeper"]); ?></td>
                        <td><?php echo ($item["phone"]); ?></td>
                        <td><?php echo (date('Y-m-d',$item["add_time"])); ?></td>
                        <td><?php echo ($item["idcard"]); ?></td>
                        <td><?php echo ($item["bankcard"]); ?> </td>
                        <td><?php echo ($item["provin"]); ?></td>
                        <td><?php echo ($item["city"]); ?></td>
                        <td><?php echo ($item["school"]); ?></td>
                        <td><?php echo ($item["point"]); ?></td>
			
                        
			 <?php if($item["buss_status"] == 1 ): ?><td>待审核</td>
			 <?php elseif($item["buss_status"] == 2 ): ?>
			 <td>未显示</td>
                          <?php elseif($item["buss_status"] == 3 ): ?>
			 <td>显示中</td>
                          <?php else: ?>
		         <td>禁用</td><?php endif; ?>
				
                    
                         <td><a href="<?php echo U('Product/index','&shop_id='.$item['shop_id']);?>">查看</a></td>
                         
                         
                         
                         
                         <?php if($item["shop_type"] == 1): ?><td>
                         <?php if($item["is_set"] == 2 ): ?><a href="<?php echo U('shopMange/is_set','id='.$item['id'].'&is_set='.$item['is_set']);?>" title="取消" onClick="javascript:if(confirm('取消为国际品牌 ？')){return true;}else{return false;}">取消</a>
			 <?php else: ?>
			 <a href="<?php echo U('shopMange/is_set','id='.$item['id'].'&is_set='.$item['is_set']);?>" title="设置" onClick="javascript:if(confirm('确定设置为国际品牌？')){return true;}else{return false;}">设置</a><?php endif; ?>
                         </td>
                         
                         <?php else: ?>
                            <td>  <a href="javascript:void(0);" title="设置" onClick="javascript:if(confirm('只有A类商家可设置为国际品牌')){return true;}else{return false;}">无此功能</a>   </td><?php endif; ?>
                     
                         
                         <td><a href="<?php echo U('shopMange/editPoint','&id='.$item['id']);?>">详情</a> 
                             
		      
                          <?php if($item["buss_status"] == 1 ): ?><!-- 待审核-->
                                 <a href="javascript:void(0);" title="未审核" onClick="javascript:if(confirm('此店铺尚未审核')){return true;}else{return false;}">启用</a>
			 <?php elseif($item["buss_status"] == 2 ): ?>
			<!-- 未显示-->
                                <a href="javascript:void(0);" title="未显示" onClick="javascript:if(confirm('此店铺没有剩余红包')){return true;}else{return false;}">启用</a>
                          <?php elseif($item["buss_status"] == 3 ): ?>
		        <!-- 显示中-->	
                                <a href="<?php echo U('shopMange/busstatus','id='.$item['id'].'&buss_status='.$item['buss_status']);?>" title="禁用" onClick="javascript:if(confirm('确定禁用此店铺？')){return true;}else{return false;}">禁用</a>
                          <?php else: ?>
		         <!-- 禁用-->	
                                <a href="<?php echo U('shopMange/busstatus','id='.$item['id'].'&buss_status='.$item['buss_status']);?>" title="启用" onClick="javascript:if(confirm('确定启用此店铺？')){return true;}else{return false;}">启用</a><?php endif; ?>
                         
                				
			</td>
                    </tr><?php endforeach; else: endif; ?>
				
				
				
                </tbody>
            </table>
              <?php echo ($page); ?>
        </div>
    </div>
</div>

<script src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script src="/App/Admin/public/js/bootstrap.min.js"></script>
<script src="/App/Admin/public/js/jquery.datetimepicker.js"></script>
<script src="/App/Admin/public/js/jquery.bootgrid.min.js"></script>
<script src="/App/Admin/public/js/jquery.bootgrid.fa.min.js"></script>
<script src="/App/Admin/public/js/time.js"></script>


<script type="text/javascript">
$("select").change(function(){
 var t=$(this)
var checkText=$(this).find("option:selected").text();
var checkValue=$(this).find("option:selected").attr("id");
var tid=$(this).find("option:selected").attr("tid");
      $.get('/type/type',{'id':checkValue,'tid':tid},function(data){
        
            t.parent().next().find("select").html("");
            t.parent().next().find("select").append(data);
            //alert(data);
      })
 
 //alert(checkValue);
});
</script>

<script>
$("#select_id1").change(function(){
var checkValueOne=$("#select_id1").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id2").text(' ');
               $("#select_id2").append(data);
            
        });
});
</script>


<script>
$("#select_id2").change(function(){
var checkValueOne=$("#select_id2").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id3").text(' ');
               $("#select_id3").append(data);
            
        });
});
</script>


<script>
$("#select_id3").change(function(){
var checkValueOne=$("#select_id3").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_class');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id4").text(' ');
               $("#select_id4").append(data);
            
        });
});
</script>



<script>
$("#select_id5").change(function(){
var checkValueOne=$("#select_id5").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_address');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id6").text(' ');
               $("#select_id6").append(data);
            
        });
});
</script>


<script>
$("#select_id6").change(function(){
var checkValueOne=$("#select_id6").val(); //获取Select选择的Value
/*alert(checkValueOne);die();*/
 $.post('<?php echo U('ShopMange/select_address');?>',{checkValueOne:checkValueOne},function(data){
               $("#select_id7").text(' ');
               $("#select_id7").append(data);
            
        });
});
</script>

</body>
</html>